import React, { Component } from 'react';

import '../../styles/Home/MySlideshow.css'

// 导入封装的方法(轮播图)
// import { getBanner } from '../../api/index.js'

import { Swiper } from 'antd-mobile'

class MySlideshow extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <div className='slideshow'>
                <Swiper autoplay loop autoplayInterval={1000}>
                    {
                        this.props.piglist && this.props.piglist.length && this.props.piglist.map((item,index)=>{
                            return (
                                <Swiper.Item key={index}>
                                    <img src={item.pic} alt="" />
                                </Swiper.Item>
                            )
                        })
                    }
                </Swiper>
            </div>
        );
    }
}

export default MySlideshow;